package cartagows.wsframework.core;

import java.io.Serializable;


public class Request implements IRequest,Serializable{

	private static final long serialVersionUID = 1L;
	private String requestID;
	private String recipientWSDLURI;
	private String recipientServiceName;
	private String recipientServicePort;
	private String requestorEPR;
	private IOperation operationInfo;
	private DataContainer requestData;
	private DataContainer requestResult;
	private boolean requestCompleted;
	private boolean requestSucceeded;
		
	public Request(String recipientWSDLURI, String recipientServiceName, String recipientServicePort, String requestorEPR, IOperation operationInfo, DataContainer data){
		this.recipientWSDLURI = recipientWSDLURI;
		this.recipientServiceName = recipientServiceName;
		this.requestorEPR = requestorEPR;
		this.requestCompleted = false;
		this.requestData = data;
		this.operationInfo = operationInfo;
		this.recipientServicePort = recipientServicePort; 
	}

	public IOperation getOperationInfo(){
		return this.operationInfo;
	}
	
	public DataContainer getRequestData(){
		return this.requestData;
	}

	public DataContainer getRequestResult() {
		return this.requestResult;
	}

	public boolean isRequestCompleted() {
		return this.requestCompleted;
	}

	public void notifyRequestCompletion(DataContainer requestResult,boolean isRequestSucceeded) {
		this.requestCompleted = true;
		this.requestResult = requestResult;
		this.requestSucceeded = isRequestSucceeded;
	}

	public boolean isRequestSucceeded() {
		return requestSucceeded;
	}

	public String getRecipientWSDLURI() {
		return recipientWSDLURI;
	}
	public String getRequestorEPR() {
		return requestorEPR;
	}

	public String getRequestID() {
		return this.requestID;
	}

	public void setRequestID(String requestID) {
		this.requestID = requestID;
	}

	public String getRecipientServiceName() {
		return recipientServiceName;
	}

	public String getRecipientServicePort() {
		return recipientServicePort;
	}
}